/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponseBoolean } from "../models/BaseResponseBoolean";
import type { BaseResponseIPageQuestionTinyVo } from "../models/BaseResponseIPageQuestionTinyVo";
import type { BaseResponseIPageQuestionVo } from "../models/BaseResponseIPageQuestionVo";
import type { BaseResponseLong } from "../models/BaseResponseLong";
import type { BaseResponseQuestionVo } from "../models/BaseResponseQuestionVo";
import type { IdRequest } from "../models/IdRequest";
import type { QuestionAddRequest } from "../models/QuestionAddRequest";
import type { QuestionQueryRequest } from "../models/QuestionQueryRequest";
import type { QuestionUpdateRequest } from "../models/QuestionUpdateRequest";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";

export class QuestionControllerService {
  /**
   * @param questionId
   * @param formData
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static uploadJudgeCases(
    questionId: number,
    formData?: {
      file: Blob;
    }
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/upload/judgeCases",
      query: {
        "questionId": questionId
      },
      formData: formData,
      mediaType: "multipart/form-data"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static updateQuestion(
    requestBody: QuestionUpdateRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/update",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseIPageQuestionVo OK
   * @throws ApiError
   */
  public static listMyQuestionVoByPage(
    requestBody: QuestionQueryRequest
  ): CancelablePromise<BaseResponseIPageQuestionVo> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/my/list/page/vo",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseIPageQuestionVo OK
   * @throws ApiError
   */
  public static listQuestionVoByPage(
    requestBody: QuestionQueryRequest
  ): CancelablePromise<BaseResponseIPageQuestionVo> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/list/page/vo",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseIPageQuestionTinyVo OK
   * @throws ApiError
   */
  public static listQuestionTinyVoByPage(
    requestBody: QuestionQueryRequest
  ): CancelablePromise<BaseResponseIPageQuestionTinyVo> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/list/page/tiny/vo",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseBoolean OK
   * @throws ApiError
   */
  public static deleteQuestion(
    requestBody: IdRequest
  ): CancelablePromise<BaseResponseBoolean> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/delete",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param requestBody
   * @returns BaseResponseLong OK
   * @throws ApiError
   */
  public static addQuestion(
    requestBody: QuestionAddRequest
  ): CancelablePromise<BaseResponseLong> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/question/add",
      body: requestBody,
      mediaType: "application/json"
    });
  }

  /**
   * @param id
   * @returns BaseResponseQuestionVo OK
   * @throws ApiError
   */
  public static getQuestionById(
    id: number
  ): CancelablePromise<BaseResponseQuestionVo> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/question/get",
      query: {
        "id": id
      }
    });
  }
}
